﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_FIT_TRAINING_TYPE_Get_Training_Type_Summary')
	BEGIN
		DROP Procedure usp_UPDMS_FIT_TRAINING_TYPE_Get_Training_Type_Summary
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_FIT_TRAINING_TYPE_Get_Training_Type_Summary
**	Desc : 운동종류요약본을 조회한다.
**	Test Exec Query : Exec usp_UPDMS_FIT_TRAINING_TYPE_Get_Training_Type_Summary 'TT001', 'ko'
**	Called by : Fit_Dac_UPDMS_FIT_TRAINING_TYPE.cs
**	Program ID : Fit3010p
**	Auth : 송시명
**	Date : 2014-05-23
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_FIT_TRAINING_TYPE_Get_Training_Type_Summary]
@ls_training_type_id nvarchar(5),
@ls_lang_set nvarchar(2)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

DECLARE @Seq int

SELECT @Seq = Seq
  FROM UPDMS_FIT_TRAINING_TYPE WITH(NOLOCK)
 WHERE Training_Type_Id = @ls_training_type_id  

--첨부파일
SELECT File_Dir,
       File_Nm,
	   File_Ext
  FROM UPDMS_COM_FILE WITH(NOLOCK)
 WHERE Activity_Id = @Seq
   AND Activity_Cd = 'Fit1010m'


--운동종류
SELECT Training_Part,
       dbo.ufn_UPDMS_Get_Code_Name(Training_Part, 'FIT', @ls_lang_set) AS Training_Part_Nm,
       Training_Nm,
       Training_Muscle_Major,
       Training_Muscle_Minor,
       Howto,
       Precaution,
       Tip,
       Weight_Calc_Rate
  FROM UPDMS_FIT_TRAINING_TYPE WITH(NOLOCK)
 WHERE Seq = @Seq

GO